﻿///////////////////////////////////////////////////////////////
//                                                           //
// Code from Arcanea Project.                                //
//                                                           //
// Please include this license part to every reproduction    //
//   of code.                                                //
//                                                           //
// This code is under Ms-RL license                          //
//                                                           //
// Please read futher information about the license,         //
//   the project (news and updates) and the                  //
//   contributors on the address :                           //
//     http://www.codeplex.com/Arcanea/                      //
//                                                           //
///////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;
using Arcanea.BaseEngine.Interfaces;
using System.Data.SqlClient;
using System.Data;
using MySql.Data.MySqlClient;
using Arcanea.Mediator.Exceptions;

namespace Arcanea.BaseEngine.SqlServer
{
    /// <summary>
    /// Classe fournissant le conteneur ResultSet pour MySql
    /// </summary>
    public class MySqlResultSet : IBaseResultSet
    {
        MySqlDataReader sqldR = null;

        public MySqlResultSet(MySqlDataReader reader)
        {
            this.sqldR = reader;
        }


        public override void Close()
        {
            this.sqldR.Close();
        }

        public override bool NextResult()
        {
            return this.sqldR.Read();
        }


        public override bool GetBool(int index)
        {
            return this.sqldR.GetBoolean(index);
        }

        public override Byte GetByte(int index)
        {
            return this.sqldR.GetByte(index);
        }

        public override Int16 GetInt16(int index)
        {
            return this.sqldR.GetInt16(index);
        }

        public override Int32 GetInt32(int index)
        {
            return this.sqldR.GetInt32(index);
        }

        public override Int64 GetInt64(int index)
        {
            return this.sqldR.GetInt64(index);
        }

        public override Single GetSingle(int index)
        {
            return this.sqldR.GetFloat(index);
        }

        public override Decimal GetDecimal(int index)
        {
            return this.sqldR.GetDecimal(index);
        }

        public override Double GetDouble(int index)
        {
            return this.sqldR.GetDouble(index);
        }

        public override DateTime GetDateTime(int index)
        {
            return this.sqldR.GetDateTime(index);
        }

        public override string GetString(int index)
        {
            return this.sqldR.GetString(index);
        }
    }
}
